#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# @Time    : 2025/9/26 18:23
# @Author  : WXY
# @File    : SimpleSplashScreen
# @PROJECT_NAME: youtubedown_gui
# @PRODUCT_NAME: PyCharm
# -------------------------------------------------------------------------------
import sys
import os
from PySide6.QtWidgets import QApplication, QMainWindow, QLabel, QVBoxLayout, QWidget
from PySide6.QtCore import Qt
from PySide6.QtGui import QPixmap


class SimpleSplashScreen(QMainWindow):
    def __init__(self):
        super().__init__()
        self.setWindowTitle("简单启动界面测试")
        self.setGeometry(300, 300, 800, 600)

        # 设置无边框窗口
        self.setWindowFlags(Qt.WindowType.FramelessWindowHint)

        # 创建中央widget
        central_widget = QWidget()
        self.setCentralWidget(central_widget)

        # 创建布局
        layout = QVBoxLayout(central_widget)

        # 添加标题
        title_label = QLabel("🎬 YouTube 视频下载器")
        title_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
        title_label.setStyleSheet("""
            QLabel {
                color: white;
                font-size: 28px;
                font-weight: bold;
                background: transparent;
            }
        """)

        # 设置窗口样式
        self.setStyleSheet("""
            QMainWindow {
                background: qlineargradient(x1:0, y1:0, x2:1, y2:1, 
                    stop:0 #0f0f23, 
                    stop:0.3 #1a1a2e, 
                    stop:0.6 #16213e, 
                    stop:1 #0f3460);
                border-radius: 16px;
            }
        """)

        layout.addWidget(title_label)


def main():
    app = QApplication(sys.argv)
    splash = SimpleSplashScreen()
    splash.show()
    return app.exec()


if __name__ == "__main__":
    sys.exit(main())